use strict;
my @a1=qw(long long ago there lived a king);
my @a2=qw(123 456 789 900);

my @retarray = callee($#a1,@a1,@a2);
my $num=shift @retarray;
my @ret1=@retarray[0..$num];
my @ret2=@retarray[$num+1..$#retarray];

print join("\n",@ret1);
print "\n----------\n";
print join("\n",@ret2);

sub callee
{
    my $array1_num=shift;
    my @params = @_;
    my @arg1 = @_[0..$array1_num];
    my @arg2 = @_[$array1_num+1..$#_];
    
    print join("\n",@arg1);
    print "\n----------\n";
    print join("\n",@arg2);
    print "\n----------\n";
    return $#arg2,@arg2,@arg1;
}